@import '../../../themes/mixins/link';
@import '../../../themes/mixins/animations';

.component {
  color: var(--theme-transactions-list-item-details-color);
  cursor: pointer;
  position: relative;

  :global {
    .SimpleLink_root.SimpleLink_underlined {
      border-bottom: none;

      &:hover {
        border-bottom: 1px solid var(--rp-link-color);
        margin-bottom: 2px;
      }
    }
  }
}

// ========= TOGGLER =========

.toggler {
  cursor: pointer;
  display: flex;
  padding: 20px;
  -webkit-user-select: none;
}

.arrow {
  bottom: 10px;
  display: none;
  margin-left: -79px;
  margin-top: -17px;
  opacity: 0.1;
  position: sticky;
  text-align: center;
  width: 74px;
  z-index: 1;

  > svg {
    height: 8px;
    width: 25px;

    path {
      stroke: var(--theme-transactions-arrow-stroke-color);
    }
  }

  .component:hover & {
    opacity: 0.2;
  }

  .content:hover & {
    opacity: 0.1;

    &:hover {
      opacity: 0.2;
    }
  }
}

.arrowExpanded {
  display: block;
}

.togglerContent {
  flex: 1;
  margin-left: 20px;
  padding-top: 1px;
}

.header,
.details {
  color: var(--theme-transactions-list-item-details-color);
  display: flex;
  width: 100%;
}

.title,
.amount {
  color: var(--theme-transactions-list-item-details-color);
  font-family: var(--font-semibold);
  font-size: 16px;
  height: 22px;
  line-height: 1.38;
  text-align: left;
}

.amount {
  font-family: var(--font-medium);
  font-size: 16px;
  margin-left: auto;
  user-select: text;

  span {
    padding-left: 5px;
    text-transform: uppercase;
  }
}

.pendingLabel,
.okLabel,
.expiredLabel,
.in_ledgerLabel,
.pendingWarningLabel {
  background-color: var(--theme-transactions-state-pending-background-color);
  border-radius: 3px;
  color: var(--theme-transactions-state-text-color);
  display: inline-block;
  font-family: var(--font-bold);
  font-size: 8px;
  line-height: 16px;
  margin-left: auto;
  margin-top: 3px;
  padding: 0 9px;
  text-transform: uppercase;
}

.okLabel,
.in_ledgerLabel {
  background-color: var(--theme-transactions-state-ok-background-color);
}

.pendingWarningLabel {
  background-color: var(
    --theme-transactions-state-pending-warning-background-color
  );
}

.expiredLabel {
  background-color: var(
    --theme-transactions-state-pending-warning-background-color
  );
}

.type {
  font-family: var(--font-light);
  font-size: 14px;
  margin-top: 3px;
}

// ========= DETAILS =========

.content {
  border-bottom: 1px solid var(--theme-dialog-border-color);
  margin-left: 84px;
  margin-right: 20px;
}

.contentExpanded {
  margin-top: -10px;
  padding-bottom: 20px;
}

.last {
  border: none;
}

.details {
  cursor: default;
  height: auto;

  .row {
    &.retainHeight {
      min-height: 40px;
    }
  }

  * + h2,
  * + .row {
    margin-top: 20px;
  }

  h2 {
    font-family: var(--font-medium);
    font-size: 16px;
    line-height: 1.38;
    margin-bottom: 4px;
  }

  h3 {
    font-family: var(--font-light);
    font-size: 16px;
  }

  .addressRow,
  .explorerLinkRow {
    padding-bottom: 5px;
  }

  .addressRow,
  .transactionIdRow,
  .explorerLinkRow {
    line-height: 17px;
  }

  .explorerLinkRow {
    span:nth-child(2) {
      color: var(--theme-transactions-list-item-details-color);
      font-family: var(--font-light);
      font-size: 16px;
      line-height: 1.38;
      margin-left: 6px;
      word-break: break-word;
    }
  }

  span {
    font-family: var(--font-light);
    font-size: 15px;

    &.address,
    &.transactionId {
      font-family: var(--font-mono);
      letter-spacing: 0.5px;
      line-height: 1.4;
      margin-bottom: 3px;
      user-select: text;
      word-break: break-all;
    }

    &.explorerLink {
      font-family: var(--font-regular);
      font-size: 16px;
      letter-spacing: -0.4px;
    }
  }

  .pendingTxnNote {
    font-family: var(--font-light);
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 20px;
    margin-top: 20px;

    .articleLink {
      font-size: 16px;
      margin-left: 5px;
    }
  }
}

.detailsClosed {
  max-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.detailsExpanded {
  max-height: 100%;
  padding: 10px 0 0;

  > div {
    width: 100%;
  }
}

.receiverRow {
  display: flex;
  flex-direction: column;
  margin-top: 15px;

  .receiverRowItem {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    h2 {
      display: flex;
      margin-bottom: 10px;
    }

    .receiverRowItemAddresses {
      align-items: flex-start;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      width: 100%;
    }
  }
}

.conversion {
  display: flex;
}

.conversionRate {
  margin-left: 76px;
}

.currencySymbol {
  display: inline-block;
  margin-bottom: -1px;
  margin-left: 4px;

  & > svg {
    height: 12px;
    width: 12px;

    & > g > g {
      stroke: var(--theme-icon-transactions-ada-symbol-color);
    }
  }
}

.metadataDisclaimer {
  font-family: var(--font-light);
  font-size: 16px;
  line-height: 22px;
}

.metadata {
  margin-top: 20px;

  pre {
    white-space: pre-wrap;
    word-break: break-all;
  }
}

.transactionFeeValue,
.depositValue {
  color: var(--theme-transactions-list-item-highlight-color);
  font-family: var(--font-medium);

  span {
    font-family: var(--font-light);
  }
}

.transactionMetadata {
  font-family: var(--font-regular);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.38;
}

.assetContainer {
  display: flex;
  justify-content: space-between;
  padding: 3px 0 3px 20px;
  position: relative;
  width: 100%;

  .assetsSeparator {
    border-bottom: 1px solid var(--theme-transactions-list-item-details-color);
    border-bottom-left-radius: 2px;
    border-left: 1px solid var(--theme-transactions-list-item-details-color);
    display: none;
    height: 35px;
    left: 3px;
    opacity: 0.3;
    position: absolute;
    top: 0;
    width: 6px;

    &.expanded {
      display: block;
    }
  }

  h3 {
    display: inline-flex;

    > span {
      margin-right: 12px;
      white-space: nowrap;

      &.fetchingTokenData {
        @include animated-ellipsis($duration: 1500, $width: 16px);
        --webkit-backface-visibility: hidden;
      }
    }
  }

  &:last-child {
    padding: 3px 0 0 20px;
  }
}

.assetToken {
  margin-top: -2px;
}

.assetAmount {
  background-color: var(--theme-staking-stake-pool-grey-bg-color);
  border-radius: 3px;
  display: flex;
  flex-direction: row;
  height: 21px;
  justify-content: flex-end;
  max-width: 250px;
  padding: 3px 9px;

  span {
    font-family: var(--font-semibold);
    font-size: 11px;
    line-height: 1.38;
  }
}
